import uvicorn
import logging
from app.main import create_app

# 配置日志
logging.basicConfig(
    level=logging.INFO,
    format='%(asctime)s - %(name)s - %(levelname)s - %(message)s'
)
logger = logging.getLogger(__name__)

def run_server():
    """
    启动服务器
    """
    logger.info("正在启动服务器...")
    uvicorn.run(
        "app.main:create_app",
        host="0.0.0.0",
        port=8000,
        reload=True,
        factory=True
    )

if __name__ == "__main__":
    run_server()